package design_pattern.Proxy;

public class SubjectImplProxy implements Subject{
    private SubjectImpl subject;
    public SubjectImplProxy(SubjectImpl subject){
        this.subject = subject;
    }

    @Override
    public void Work() {
        System.out.println("代理后前置增强");
        subject.Work();
        System.out.println("代理后后置增强");

    }

    public static void main(String[] args) {
        SubjectImpl subject = new SubjectImpl();
        SubjectImplProxy p = new SubjectImplProxy(subject);
        p.Work();
    }
}
